// user token userInfo
export default class AuthStorage {
  static set token (value) {
    if (value) {
      window.sessionStorage.setItem('token', value)
    } else {
      window.sessionStorage.removeItem('token')
    }
  }
  static get token () {
    return window.sessionStorage.getItem('token') || null
  }
  static set userType (value) {
    if (value) {
      window.sessionStorage.setItem('userType', value)
    } else {
      window.sessionStorage.removeItem('userType')
    }
  }
  static get userType () {
    return window.sessionStorage.getItem('userType') || null
  }
  static set user (value) {
    if (value) {
      window.sessionStorage.setItem('user', value)
    } else {
      window.sessionStorage.removeItem('user')
    }
  }
  static get user () {
    return window.sessionStorage.getItem('user') || null
  }
  static set userInfo (value) {
    if (value) {
      window.sessionStorage.setItem('userInfo', JSON.stringify(value))
    } else {
      window.sessionStorage.removeItem('userInfo')
    }
  }
  static get userInfo () {
    return window.sessionStorage.getItem('userInfo') || null
  }
}
